// pages/my/collection/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    list: [
      {
        title: "落雪红梅1",
        duihuan: "234",
        image:
          "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1548059676685&di=7c2acd69f88b1f1cb19c072544eb794c&imgtype=0&src=http%3A%2F%2Fh.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2Ff9dcd100baa1cd11dd124eafb412c8fcc2ce2d9c.jpg",
        price: "13124"
      },
      {
        title: "落雪红梅2",
        duihuan: "4435",
        image:
          "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1548059676685&di=d4d3a5886b086730332a17195dcef6a7&imgtype=0&src=http%3A%2F%2Fc.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2F9c16fdfaaf51f3de561b2e9499eef01f3b297991.jpg",
        price: "676"
      },
      {
        title: "落雪红梅3",
        duihuan: "341",
        image:
          "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1548059676685&di=3c1a3a10033fa0a94a2205a61b1d1925&imgtype=0&src=http%3A%2F%2Fc.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2F5882b2b7d0a20cf4f3c4692f7b094b36adaf99ee.jpg",
        price: "423"
      }
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) { },

  onDelete({ currentTarget: { dataset: { index } } }) {
    console.log(index);
    let list = this.data.list;
    list.splice(index, 1);
    setTimeout(() => {
      this.setData({ list });
    }, 500)
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () { },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () { },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () { },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () { },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () { },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () { },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () { }
});
